package org2.jogo.activities;

import org2.jogo.Global;
import org2.jogo.R;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends GameActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Global.mainActivity = this;
		Global.lerPreferencias();
		Button buttonGame = (Button) findViewById(R.id.btnNewGame);
		Button buttonLeader = (Button) findViewById(R.id.btnLeaderboard);
		Button buttonInstrucoes = (Button) findViewById(R.id.btnInstrucoes);
		Button buttonOpcoes = (Button) findViewById(R.id.btnOpcoes);
		Button buttonQuit = (Button) findViewById(R.id.btnQuit);
		View.OnClickListener listener = new View.OnClickListener() {
			public void onClick(View v) {
				switch (v.getId()) {
				case R.id.btnNewGame:
					Intent i = new Intent(MainActivity.this, EditNomeActivity.class);
					startActivity(i);
					break;
				case R.id.btnQuit:
					moveTaskToBack(true);
					break;
				case R.id.btnLeaderboard:
                    startActivity(new Intent(MainActivity.this, LeaderboardActivity.class));
                    break;
				case R.id.btnInstrucoes:
				    startActivity(new Intent(MainActivity.this, InstrucoesActivity.class));
				    break;
				case R.id.btnOpcoes:
				    startActivity(new Intent(MainActivity.this, OpcoesActivity.class));
				    break;
				}
			}
		};
		buttonGame.setOnClickListener(listener);
		buttonLeader.setOnClickListener(listener);
		buttonInstrucoes.setOnClickListener(listener);
		buttonOpcoes.setOnClickListener(listener);
		buttonQuit.setOnClickListener(listener);
	}
	
    @Override
    protected int getContentView() {
        return R.layout.main;
    }

    @Override
    protected int getMusicaFundo() {
        return R.raw.music_bg_main;
    }

    @Override
    protected String getTitulo() {
        return "Início";
    }
}